package br.com.cefetrn.apoena.dominio.home;
// Generated 01/01/2008 17:35:51 by Hibernate Tools 3.2.0.b11


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import br.com.cefetrn.apoena.dominio.entity.AreasAtuacaoPublicoAlvo;
import br.com.cefetrn.apoena.dominio.entity.AreasDeAtuacao;
import br.com.cefetrn.apoena.dominio.entity.PublicoAlvo;

/**
 * Home object for domain model class AreasDeAtuacao.
 * @see br.com.cefetrn.apoena.dominio.entity.AreasDeAtuacao
 * @author Gilmar P.S.L.
 */
public class Home4AreasDeAtuacao extends AxHomeGeneric<AreasDeAtuacao, Integer>{
	
	
    public Map<AreasDeAtuacao,List<PublicoAlvo>> findArea2PublicoAlvo(){
    	
    	Map<AreasDeAtuacao,List<PublicoAlvo>> areas2Publico = new HashMap<AreasDeAtuacao, List<PublicoAlvo>>();
    	
    	for(AreasDeAtuacao aa : findAll()){
			
    		areas2Publico.put(aa, new ArrayList<PublicoAlvo>());
			
    		for(AreasAtuacaoPublicoAlvo aapa : aa.getAreasAtuacaoPublicoAlvos())
    			areas2Publico.get(aa).add(aapa.getPublicoAlvo());
    	}

    	return areas2Publico;
    }
}

